package com.mths.client.controller;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.mths.client.annotation.Authorization;
import com.mths.client.constant.RoleType;
import com.mths.client.dto.DocClassDTO;
import com.mths.client.dto.DocMetaSaveDTO;
import com.mths.client.dto.DocMetaSearchDTO;
import com.mths.client.dto.DocTypeDTO;
import com.mths.client.dto.MetaDataDTO;
import com.mths.client.dto.MetaParamDTO;
import com.mths.client.util.ListItem;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("proxyServlet/documentController")
public interface DocumentController extends RemoteService {

	@Authorization(roles = { RoleType.ADMIN })
	void saveMetaData(MetaDataDTO dto);

	@Authorization(roles = { RoleType.ADMIN })
	List<MetaDataDTO> loadMetaDatas(MetaDataDTO dto);

	@Authorization(roles = { RoleType.ADMIN })
	void saveDocClass(DocClassDTO dto);

	@Authorization(roles = { RoleType.ADMIN })
	List<DocClassDTO> loadDocClassTable(DocClassDTO dto);

	@Authorization(roles = { RoleType.ADMIN })
	DocMetaSearchDTO loadDocMetaDataList(String docTypeOid) throws Exception;

	@Authorization(roles = { RoleType.ADMIN })
	void saveDocMetaDataList(DocMetaSaveDTO dto);

	@Authorization(roles = { RoleType.ADMIN })
	List<ListItem> loadMetaDataTypeCombo(String arg);

	@Authorization(roles = { RoleType.ADMIN })
	void saveMetaParam(MetaParamDTO dto);

	@Authorization(roles = { RoleType.ADMIN })
	List<MetaParamDTO> loadMetaParamList(String metaOid);

	@Authorization(roles = { RoleType.ADMIN, RoleType.MEMBER })
	List<ListItem> loadDocClassCombo(String string) throws Exception;

	@Authorization(roles = { RoleType.ADMIN })
	List<DocTypeDTO> loadDocTypeList(String docClassOid);

	@Authorization(roles = { RoleType.ADMIN })
	void saveDocType(DocTypeDTO dto);

	@Authorization(roles = { RoleType.ADMIN, RoleType.MEMBER })
	List<ListItem> loadDocTypeCombo(String string);

	@Authorization(roles = { RoleType.ADMIN, RoleType.MEMBER })
	List<MetaDataDTO> loadMeataWidgetByDocType(String docTypeOid);

}
